import React from "react";
import { Redirect } from "react-router-dom";

const CLDiscover = React.lazy((_) => import("../pages/discover"));
const CLFriends = React.lazy((_) => import("../pages/friends"));
const CLMine = React.lazy((_) => import("../pages/mine"));
const CLAlbun = React.lazy((_) =>
  import("../pages/discover/child-pages/album")
);
const CLArtist = React.lazy((_) =>
  import("../pages/discover/child-pages/artist")
);
const CLDjradio = React.lazy((_) =>
  import("../pages/discover/child-pages/djradio")
);
const CLRanking = React.lazy((_) =>
  import("../pages/discover/child-pages/ranking")
);
const CLRecommend = React.lazy((_) =>
  import("../pages/discover/child-pages/recommend")
);
const CLSongs = React.lazy((_) =>
  import("../pages/discover/child-pages/songs")
);
const CLPlayer = React.lazy((_) => import("../pages/player"));

// import CLDiscover from "../pages/discover";
// import CLFriends from "../pages/friends";
// import CLMine from "../pages/mine";
// import CLAlbun from "../pages/discover/child-pages/album";
// import CLArtist from "../pages/discover/child-pages/artist";
// import CLDjradio from "../pages/discover/child-pages/djradio";
// import CLRanking from "../pages/discover/child-pages/ranking";
// import CLRecommend from "../pages/discover/child-pages/recommend";
// import CLSongs from "../pages/discover/child-pages/songs";
// import CLPlayer from "../pages/player";
const routes = [
  {
    path: "/",
    exact: true,
    render: () => <Redirect to="/discover" />,
  },
  {
    path: "/discover",
    component: CLDiscover,
    routes: [
      {
        path: "/discover",
        exact: true,
        render: () => <Redirect to="/discover/recommend" />,
      },
      {
        path: "/discover/album",
        component: CLAlbun,
      },
      {
        path: "/discover/artist",
        component: CLArtist,
      },
      {
        path: "/discover/djradio",
        component: CLDjradio,
      },
      {
        path: "/discover/ranking",
        component: CLRanking,
      },
      {
        path: "/discover/recommend",
        component: CLRecommend,
      },
      {
        path: "/discover/songs",
        component: CLSongs,
      },
      {
        path: "/discover/player",
        component: CLPlayer,
      },
    ],
  },
  {
    path: "/friend",
    component: CLFriends,
  },
  {
    path: "/mine",
    component: CLMine,
  },
];

export default routes;
